﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using Ooaavee.TestTools;

namespace UnitTests
{
    /// <summary>
    /// This is a sample TestParametersAttribute implementation.
    /// 
    /// In this example the overridden GetParameters method return five parameters. Of cource, your own 
    /// implementation can read parameters for example from a database, file...
    /// </summary>
    [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = false)]
    public class MyCustomTestParametersAttribute : TestParametersAttribute
    {
        /// <summary>
        /// Gets parameters for a test method.
        /// </summary>
        /// <param name="testClass">the name of the calling test class</param>
        /// <param name="testMethod">the name of the calling test method</param>
        /// <returns>parameters</returns>
        public override ReadOnlyCollection<object> GetParameters(string testClass, string testMethod)
        {
            List<object> parameters = new List<object>();

            string first = "Hello Test Method: " + testClass + "." + testMethod;
            parameters.Add(first);

            int second = 1234567890;
            parameters.Add(second);

            decimal third = -1.2345m;
            parameters.Add(third);

            object fourth = null;
            parameters.Add(fourth);

            DateTime fifth = DateTime.Now.Date;
            parameters.Add(fifth);

            return parameters.AsReadOnly();
        }
    }
}
